/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cis36b.project1;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
/**
 * this was just a test to help me understand dealing with swing components
 * this file probably won't make it into the final version.
 *
 * @author Jonah
 */
public class TestFrame {
    
    public JFrame frame = new JFrame();
    private JPanel gameBoard = new JPanel();
    private JPanel UI = new JPanel();
    private JButton testButton = new JButton();
    
    private Dimension gbDim = new Dimension(480,480);
    private Dimension uiDim = new Dimension(160,160);
    
    private int rows;
    private int cols;
    private int gridSquare;
    
    
    //constructor
    public TestFrame() {
        initComponents();
    }
    
    private void initComponents() {
        gameBoard.setPreferredSize(gbDim);
        gameBoard.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        UI.setPreferredSize(uiDim);
        UI.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        UI.add(testButton);
        testButton.setText("test");
        testButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent testPressed) {
                testButtonActionPerformed(testPressed);
            }
        });
        
        frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        frame.getContentPane().add(gameBoard, BorderLayout.WEST);
        frame.getContentPane().add(UI, BorderLayout.EAST);
        frame.pack();
    }
    
    private void testButtonActionPerformed(java.awt.event.ActionEvent testPressed) {
        resizeFrame();
        initComponents();
    }
        
    private void resizeFrame(){
        gbDim.setSize(240, 240);
        
    }
}
